package com.project.service.impl;

import com.project.bean.StudentBean;
import com.project.mapper.IStudentMapper;
import com.project.service.IStudentService;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class StudentServiceImpl extends BaseService implements IStudentService {
    @Override
    public void add(StudentBean student) {
        //得到会话
        SqlSession session = this.getSession();
        //得到mapper接口实现类对象
        IStudentMapper mapper = session.getMapper(IStudentMapper.class);
        //执行持久方法，完成操作
        mapper.add(student);
        //提交事务
        session.commit();
        //关闭session
        session.close();
    }

    @Override
    public void del(Integer id) {

    }

    @Override
    public void update(Integer id, String phone) {

    }

    @Override
    public List<StudentBean> findAll() {
        return null;
    }

    @Override
    public StudentBean findById(Integer id) {
        return null;
    }
}
